package 剑指offer.zw_11_旋转数组的最小数字;

class Solution {
    public static void main(String[] args) {
        int[] nums = {3,4,5,1,2};
        int minArray = minArray(nums);
        System.out.println(minArray);
    }
    public static int minArray(int[] nums) {
        int i = 0, j = nums.length - 1;
        while (i < j) {
            int m = (i + j) / 2;
            if (nums[m] > nums[j]) i = m + 1;
            else if (nums[m] < nums[j]) j = m;
            else j--;
        }
        return nums[i];
    }
}
